<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变量</title>
</head>

<body>
    <script>
        var i;
        alert(i) // 变量只声明没有赋值，系统默认赋值undefined,在JS当中undefined是一个具体存在的值

        var x = "undefined";
        alert(x) // "undefined"这个不是undefined，它是一个字符串

        // 声明时，同事赋值
        var k = 100;
        alert(k + 1) // 101

        k = false;
        alert(k)

        k = "abc";
        alert(k)

        var a, b, c = 100;
        alert(a)
        alert(b)
        alert(c)
    </script>
</body>

</html>